/*************************************

Wander script

Auth: Simon J. Symeonidis
Jan 2010
Contact: lethaljellybean at gmail.com 

--------------------------------------

Typical script to make npcs walk 
around aimlessly.

**************************************/
RequireSystemScript("time.js");

function wander(p){

var t;
var r = Math.floor(Math.random()*5);

if(r==0)
{
	QueuePersonCommand(p, COMMAND_FACE_EAST, false);
	for(i=0; i<25; i++)
	{
		QueuePersonCommand(p, COMMAND_MOVE_EAST, false);
	}
	for(i=0; i<40; i++)
	{
		QueuePersonCommand(p, COMMAND_WAIT, false);
	}
}

if(r==1)
{
	QueuePersonCommand(p, COMMAND_FACE_SOUTH, false);
	for(i=0; i<25; i++)
	{
		QueuePersonCommand(p, COMMAND_MOVE_SOUTH, false);
	}
	for(i=0; i<40; i++)
	{
		QueuePersonCommand(p, COMMAND_WAIT, false);
	}
}

if(r==2)
{

	QueuePersonCommand(p, COMMAND_FACE_NORTH, false);
	for(i=0; i<25; i++)
	{
		QueuePersonCommand(p, COMMAND_MOVE_NORTH, false);
	}
	for(i=0; i<40; i++)
	{
		QueuePersonCommand(p, COMMAND_WAIT, false);
	}
}
if(r==3)
{

	QueuePersonCommand(p, COMMAND_FACE_NORTH, false);
	for(i=0; i<25; i++)
	{
		QueuePersonCommand(p, COMMAND_MOVE_NORTH, false);
	}
	for(i=0; i<40; i++)
	{
		QueuePersonCommand(p, COMMAND_WAIT, false);
	}
}


}